package com.jwthhealth_pub.community.view.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.community.view.CommunityDocReportActivity;

/**
 * Created by liuzhen on 2017/12/19.
 */

public class CommunityDocReportAdapter extends RecyclerView.Adapter {
    private final CommunityDocReportActivity mActivity;

    public CommunityDocReportAdapter(CommunityDocReportActivity communityDocReportActivity) {
        this.mActivity = communityDocReportActivity;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ViewHolder(View.inflate(mActivity, R.layout.item_community_docreport, null));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        ViewHolder vh = (ViewHolder) holder;
        vh.btnLeftInfo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.gotoDetail();
            }
        });
    }

    @Override
    public int getItemCount() {
        return 5;
    }

    private class ViewHolder extends RecyclerView.ViewHolder {

        ImageView icon;
        ImageButton btnLeftInfo;
        TextView name, gender, age, community, state, applayTime,  outOfData;

        public ViewHolder(View itemView) {
            super(itemView);

            btnLeftInfo = itemView.findViewById(R.id.btn_community_docreprot_gotodetail);
        }
    }
}
